package com.ywz.project.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ywz.common.ResultResp;
import com.ywz.project.base.system.entity.TSysOperLog;
import com.ywz.project.base.system.service.TSysOperLogService;
import com.ywz.project.system.dto.req.OperLogPageReq;
import com.ywz.project.system.service.SysOperLogApiService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SysOperLogApiServiceImpl implements SysOperLogApiService {
    @Resource
    private TSysOperLogService tSysOperLogService;

    @Override
    public ResultResp getOperLogPage(OperLogPageReq req) {
        LambdaQueryWrapper<TSysOperLog> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TSysOperLog::getIsDeleted, 0);
        Page<TSysOperLog> page = new Page<>(req.getPageNum(), req.getPageSize());
        return ResultResp.success(tSysOperLogService.page(page, queryWrapper));
    }
}
